# $Id$
# Maintainer: Sergej Pupykin <pupykin.s+arch@gmail.com>
# Maintainer: Patryk Kowalczyk < patryk at kowalczyk dot ws>

pkgname=spice
pkgver=0.12.8+8+ga957a90b
pkgrel=1
pkgdesc="SPICE server"
arch=('i686' 'x86_64')
url="https://www.spice-space.org"
license=('LGPL2.1')
depends=(celt0.5.1 libjpeg-turbo libsasl pixman glib2)
makedepends=(python2-pyparsing python2-six qemu spice-protocol git libcacard)
_commit=a957a90baf2c62d31f3547e56bba7d0e812d2331  # 0.12
source=("git+https://anongit.freedesktop.org/git/spice/spice#commit=$_commit"
        "git+https://anongit.freedesktop.org/git/spice/spice-common")
sha256sums=('SKIP'
            'SKIP')

pkgver() {
  cd $pkgname
  git describe --tags | sed 's/^v//;s/-/+/g'
}

check() {
  cd $pkgname
  rm -rf .git
  make check
}

prepare() {
  cd $pkgname
  NOCONFIGURE=1 ./autogen.sh
}

build() {
  cd "$srcdir/$pkgname"
  PYTHON=python2 ./configure --prefix=/usr --disable-static --enable-smartcard --enable-client --disable-werror
  make
}

package() {
  cd "$srcdir/$pkgname"
  make DESTDIR="$pkgdir/" install
}
